﻿@model Apps.Models.Sys.SysSampleModel
@using Apps.Common;
@using Apps.Models.Sys;
@using Apps.Web.Core;
@using Apps.Locale;
@{
    ViewBag.Title = "创建";
    Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
    List<permModel> perm = null;
}

<script type="text/javascript">
    $(function () {
        $("#btnSave").click(function () {
            if ($("form").valid()) {
                $.ajax({
                    url: "@Url.Action("Create")",
                    type: "Post",
                    data: $("form").serialize(),
                    dataType: "json",
                    success: function (data) {
                        if (data.type == 1) {
                            window.parent.frameReturnByMes(data.message);
                            window.parent.frameReturnByReload(true);
                            window.parent.frameReturnByClose()
                        }
                        else {
                            window.parent.frameReturnByMes(data.message);
                        }
                    }
                });
            }
            return false;
        });
        $("#btnReturn").click(function () {
            window.parent.frameReturnByClose();
        });
    });
</script>
<div class="mvctool bgb">
    @Html.ToolButton("btnSave", "fa fa-save", Resource.Save,ref perm, "Save", true)
    @Html.ToolButton("btnReturn", "fa fa-reply", Resource.Reply, false)
</div>


@using (Html.BeginForm())
{
    @Html.HiddenFor(model => model.Id)
    <input id="CreateTime" type="hidden" name="CreateTime" value="2000-1-1" />
    <table class="formtable">
        <tbody>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Name)：
                </th>
                <td>
                    @Html.EditorFor(model => model.Name)
                    @Html.ValidationMessageFor(model => model.Name)

                </td>

            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Age)：
                </th>
                <td>
                    @Html.EditorFor(model => model.Age)
                    @Html.ValidationMessageFor(model => model.Age)
                </td>

            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Bir)：
                </th>
                <td>
                    @Html.TextBoxFor(model => model.Bir, new {  @onClick = "WdatePicker()",@class= "Wdate" })
                    @Html.ValidationMessageFor(model => model.Bir)
                </td>

            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Photo)：
                </th>
                <td>
                    @Html.HiddenFor(model => model.Photo)
                    <img class="expic" src="/Content/Images/NotPic.jpg" /><br />
                    <a onclick="$('#FileUpload').trigger('click')" class="files">@Resource.Browse</a>
                        <input type="file" class="displaynone" id="FileUpload" name="FileUpload" onchange="Upload('SingleFile', 'Photo', 'FileUpload','1','1');" />
                    <span class="uploading">@Resource.Uploading</span>
                    @Html.ValidationMessageFor(model => model.Photo)
                </td>

            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Note)：
                </th>
                <td>
                    @Html.EditorFor(model => model.Note)
                    @Html.ValidationMessageFor(model => model.Note)
                </td>
            </tr>
        </tbody>
    </table>

}

